<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
	<style>
		.condition a{
			display: inline-block;
			padding:3px 5px;
			border:1px solid #dddddd;
			margin: 5px 5px;
		}
		.condition a.active{
			background-color: #5bc0de;
		}
	</style>
</head>
<body>
	<h1>查询条件</h1>
	<div class="condition">
		<div>
			{% if arg_dict.article_type_id == 0 %}
				<a class="active" href="article-0-{{ arg_dict.category_id }}">全部</a>
			{% else %}
				<a href="article-0-{{ arg_dict.category_id }}">全部</a>
			{% endif %}

			{% for row in article_type %}
				{% if row.id == arg_dict.article_type_id %}
					<!--巧妙的地方在于这个arg_dict-->
					<a class="active" href="/article-{{ row.id }}-{{ arg_dict.category_id }}">{{ row.caption }}</a>
				{% else %}
					<a  href="/article-{{ row.id }}-{{ arg_dict.category_id }}">{{ row.caption }}</a>
				{% endif %}
			{% endfor %}
		</div>
		<div>
			{% if arg_dict.category_id == 0 %}
				<a class="active" href="article-{{ arg_dict.article_type_id }}-0">全部</a>
			{% else %}
				<a href="article-{{ arg_dict.article_type_id }}-0">全部</a>
			{% endif %}

			{% for row in article_category %}
				{% if row.id == arg_dict.category_id %}
					<a class="active" href="/article-{{ arg_dict.article_type_id }}-{{ row.id }}">{{ row.caption }}</a>
				{% else %}
					<a  href="/article-{{ arg_dict.article_type_id }}-{{ row.id }}">{{ row.caption }}</a>
				{% endif %}
			{% endfor %}
		</div>
	</div>
	<h1>查询结果</h1>
	<ul>
		{% for row in articleobj %}
			<li>{{ row.id }} -- {{ row.title }}</li>
		{% endfor %}
	</ul>
</body>
</html>